import common.CommonDemo;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class NavigateBack {

    CommonDemo commonDemo = new CommonDemo();
    private ChromeDriver driver;
    private String webUrl;
    private String url = "https://www.baidu.com";

    @BeforeTest
    public void setUp() throws Exception{
        //获取chromedriver
        driver = commonDemo.getChromeDriver();
        webUrl = commonDemo.getPropertyValue("config.properties", "web.url.baidu");
    }

    @Test
    public void test(){
        driver.navigate().to(url);
        driver.navigate().back();
    }

    @AfterClass
    public void tearDown() throws Exception{
        Thread.sleep(2000);
        driver.quit();
    }
}
